Small patch to avoid a stack overflow (VTI only).
authordjm@kirby.fc.hp.com <djm@kirby.fc.hp.com>
Thu, 15 Dec 2005 20:51:10 +0000 (14:51 -0600)
committerdjm@kirby.fc.hp.com <djm@kirby.fc.hp.com>
Thu, 15 Dec 2005 20:51:10 +0000 (14:51 -0600)
Signed-off-by: Tristan Gingold <tristan.gingold@bull.net>
tools/libxc/xc_ia64_stubs.c

index 4b11af60e447a2ebba35c9f5bbabb64247e00d5f..ab3a6c1222037bcc7a871bc36a74250d0ba96f37 100644 (file)
@@ -182,18 +182,26 @@ static int load_hob(int xc_handle,uint32_t dom, void *hob_buf);
 
 int xc_ia64_build_hob(int xc_handle, uint32_t dom, unsigned long memsize){
 
-    char   hob_buf[GFW_HOB_SIZE];
+    char   *hob_buf;
+
+    hob_buf = malloc (GFW_HOB_SIZE);
+    if (hob_buf == NULL) {
+        PERROR("Could not allocate hob");
+        return -1;
+    }
 
     if ( build_hob( hob_buf, GFW_HOB_SIZE, memsize<<20) < 0){
+        free (hob_buf);
         PERROR("Could not build hob");
         return -1;
     }
 
     if ( load_hob( xc_handle, dom, hob_buf) <0){
+        free (hob_buf);
         PERROR("Could not load hob");
        return -1;
     }
-
+    free (hob_buf);
     return 0;
 
 }